var App = (function(App, $, _){

	'user strict';

	var deck = {};
	var moduleName = "deck"; // define a unique module name

	/* ==== PLACE MODULE CODE HERE ==== */

	var defaultIntro;

	deck.init = function() {

		// reset the deck on game reset
		App.on("reset", deck.reset);

		// bind on click event
		$("#deck .card").click(deck.clicked);

		// extract default intro
		defaultIntro = $("#deck .intro").val();

	};

	deck.reset = function() {
		$("#deck .sleeve .card").removeClass("selected");
		//("#deck .intro").val(defaultIntro);
	};

	deck.clicked = function(e) {
		
		// extract card's value
		var $card = $(e.currentTarget);
		var value = $card.html();

		//$("#deck .intro").html("Your current estimation: " + value);

		$("#deck .sleeve .card").removeClass("selected");
		$card.addClass("selected");

		App.log(gapi.hangout.getLocalParticipantId(), "selected", value);

		App.trigger("gameParticipantStatus", {
			participantId: gapi.hangout.getLocalParticipantId(),
			cardSelected: value
		});

	};

	// add module to list of modules
	App.modules = App.hasOwnProperty("modules") ? App.modules : {};
	App.modules[moduleName] = deck;

	return App;

}(App || {}, $, _));